home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / shells / tcsh602.zoo / tcsh602 / complete.tcsh next >
Text File  |  1993-02-22  |  6KB  |  169 lines

  1. #
  2. # $Id: complete.tcsh,v 1.10 1992/05/15 22:53:51 christos Exp $
  3. # example file using the new completion code
  4. #
  5.  
  6. if ($?tcsh) then
  7.     if ($tcsh != 1) then
  8.        set rev=$tcsh:r
  9.     set rel=$rev:e
  10.     set pat=$tcsh:e
  11.     set rev=$rev:r
  12.     endif
  13.     if ($rev > 5 && $rel > 1) then
  14.     set complete=1
  15.     endif
  16.     unset rev rel pat
  17. endif
  18.  
  19. if ($?complete) then
  20.     set noglob
  21.     set hosts=(hyperion phaeton guillemin theory.tc vangogh.cs.berkeley.edu)
  22.  
  23.     complete rsh    n/*/\$hosts/    # argument from list in $hosts
  24.     complete ywho      n/*/\$hosts/
  25.     complete cd      p/1/d/        # Directories only
  26.     complete chdir     p/1/d/
  27.     complete pushd     p/1/d/
  28.     complete popd     p/1/d/
  29.     complete pu     p/1/d/
  30.     complete po     p/1/d/
  31.     complete mkdir     p/1/d/
  32.     complete rmdir     p/1/d/
  33.     complete man     p/1/c/        # only commands
  34.     complete complete     p/1/c/
  35.     complete uncomplete p/1/c/
  36.     complete exec     p/1/c/
  37.     complete trace     p/1/c/
  38.     complete strace     p/1/c/
  39.     complete which     p/1/c/
  40.     complete where     p/1/c/
  41.     complete skill     p/1/c/
  42.     complete dde    p/1/c/ 
  43.     complete adb    p/1/c/ 
  44.     complete sdb    p/1/c/
  45.     complete dbx    p/1/c/
  46.     complete xdb    p/1/c/
  47.     complete gdb    p/1/c/
  48.     complete ups    p/1/c/
  49.     complete set    'c/*=/f/' 'p/1/s/=' 'n/=/f/'
  50.     complete unset    p/1/s/
  51.     complete setenv     p/1/e/        # only environment variables 
  52.     complete unsetenv     p/1/e/
  53.     complete alias     p/1/a/        # only aliases are valid
  54.     complete unalias     p/1/a/
  55.     complete xdvi     n/*/f:*.dvi/    # Only files that match *.dvi
  56.     complete dvips     n/*/f:*.dvi/
  57.     complete latex     n/*/f:*.tex/
  58.     complete tex     n/*/f:*.tex/
  59.     complete rlogin     c/-/"(l 8 e)"/ n/-l/u/ n/*/\$hosts/ 
  60.     complete xrsh       c/-/"(l 8 e)"/ n/-l/u/ n/*/\$hosts/ 
  61.     complete cc     c/-I/d/ c/-L/d/ c/-/"(o l c g L I D U)"/ \
  62.             n/*/f:*.[coa]/
  63.     complete acc     c/-I/d/ c/-L/d/ c/-/"(o l c g L I D U)"/ \
  64.             n/*/f:*.[coa]/
  65.     complete gcc     c/-I/d/ c/-L/d/ \
  66.              c/-f/"(caller-saves cse-follow-jumps delayed-branch \
  67.                        elide-constructors expensive-optimizations \
  68.                    float-store force-addr force-mem inline \
  69.                    inline-functions keep-inline-functions \
  70.                    memoize-lookups no-default-inline \
  71.                    no-defer-pop no-function-cse omit-frame-pointer \
  72.                    rerun-cse-after-loop schedule-insns \
  73.                    schedule-insns2 strength-reduce \
  74.                    thread-jumps unroll-all-loops \
  75.                    unroll-loops syntax-only all-virtual \
  76.                    cond-mismatch dollars-in-identifiers \
  77.                    enum-int-equiv no-asm no-builtin \
  78.                    no-strict-prototype signed-bitfields \
  79.                    signed-char this-is-variable unsigned-bitfields \
  80.                    unsigned-char writable-strings call-saved-reg \
  81.                    call-used-reg fixed-reg no-common \
  82.                    no-gnu-binutils nonnull-objects \
  83.                    pcc-struct-return pic PIC shared-data \
  84.                    short-enums short-double volatile)"/ \
  85.              c/-W/"(all aggregate-return cast-align cast-qual \
  86.                          comment conversion enum-clash error format \
  87.                          id-clash-len implicit missing-prototypes \
  88.                          no-parentheses pointer-arith return-type shadow \
  89.                          strict-prototypes switch uninitialized unused \
  90.                          write-strings)"/ \
  91.              c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
  92.                    short c68000 c68020 soft-float g gnu unix fpu \
  93.                    no-epilogue)"/ \
  94.              c/-d/"(D M N)"/ \
  95.              c/-/"(f W vspec v vpath ansi traditional \
  96.                   traditional-cpp trigraphs pedantic x o l c g L \
  97.                   I D U O O2 C E H B b V M MD MM i dynamic \
  98.                   nodtdlib static nostdinc undef)"/ \
  99.              c/-l/f:*.a/ \
  100.              n/*/f:*.{c,C,cc,o,a}/
  101.     complete g++     n/*/f:*.{C,cc,o}/
  102.     complete CC     n/*/f:*.{C,cc,o}/
  103.     complete rm     n/*/f:^*.{c,cc,C,h}/    # Protect precious files
  104.     complete vi     n/*/f:^*.o/
  105.     complete bindkey    N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
  106.             n/-[svedl]/n/ c/-[vedl]/n/ c/-/"(a s c v e d l r)"/ \
  107.             p/2-/b/ p/1/'x:<key-sequence or option>'/
  108.  
  109.     complete find     n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
  110.               n/-type/"(c b d f p l s)"/ n/-user/u/ n/-exec/c/ \
  111.               n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
  112.               c/-/"(fstype name perm prune type user nouser \
  113.                    group nogroup size inum atime mtime ctime exec \
  114.                  ok print ls cpio ncpio newer xdev depth)"/ \
  115.             n/*/d/
  116.  
  117.     complete kill    c/-/S/ c/%/j/
  118.     complete %*        c/%/j/            # fill in the jobs builtin
  119.     complete fg        c/%/j/
  120.     complete bg        c/%/j/
  121.     complete stop    c/%/j/
  122.  
  123.     complete limit    c/-/"(h)"/ n/*/l/
  124.     complete unlimit    c/-/"(h)"/ n/*/l/
  125.  
  126.     complete -co*    p/0/"(compress)"/    # make compress completion
  127.                         # not ambiguous
  128.     complete zcat    n/*/f:*.Z/
  129.     complete nm        n/*/f:^*.{h,C,c,cc}/
  130.  
  131.     complete finger c/*@/\$hosts/ p/1/u/@ 
  132.  
  133.     complete talk p/1/'`users | tr " " "\012" | uniq`'/ \
  134.           n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
  135.  
  136.     if ( -f $HOME/.netrc ) then
  137.     complete ftp    p@1@\`cat\ $HOME/.netrc\ \|\ \ awk\ \'\{\ print\ \$2\ \}\'\`@
  138.     else
  139.     set ftphosts=(ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
  140.               labrea.stanford.edu sumex-aim.stanford.edu \
  141.               tut.cis.ohio-state.edu)
  142.     complete ftp     n/*/\$ftphosts/
  143.     endif
  144.  
  145.     complete rcp c/*:/f/ C@[./]*@f@ n/*/\$hosts/:
  146.  
  147.     complete dd c/if=/f/ c/of=/f/ \
  148.         c/conv=*,/"(ascii ebcdic ibm block unblock \
  149.                 lcase ucase swap noerror sync)"/,\
  150.         c/conv=/"(ascii ebcdic ibm block unblock \
  151.               lcase ucase swap noerror sync)"/,\
  152.             c/*=/x:'<number>'/ \
  153.         n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
  154.  
  155.     complete emacs    c/-/"(batch d f funcall i insert kill l load \
  156.             no-init-file q t u user)"/ c/+/x:'<line_number>'/ \
  157.             n/-d/x:'<display>'/ n/-f/x:'<lisp_function>'/ n/-i/f/ \
  158.             n/-l/f:*.{el,elc}/ n/-t/x:'<terminal>'/ n/-u/u/ \
  159.             n/*/f:^*[\#~]/
  160.     complete mail    c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
  161.             n/-s/x:'<subject>'/ n/-u/u/ \
  162.             c@+@\`/bin/ls\ -1\ ~/Mail\`@ n/-f/f/ n/*/u/
  163.     complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
  164.         p/2/f:*.a/ p/*/f:*.o/
  165.  
  166.     unset noglob
  167.     unset complete
  168. endif
  169.